package org.rrs.duker;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.Button;
import android.widget.ImageView;

import com.bumptech.glide.Glide;

import org.rrs.duker.ui.activity.HomeActivity;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class MainActivity extends AppCompatActivity {

    @BindView(R.id.btn_test)
    Button btnTest;
    @BindView(R.id.btn_home)
    Button btnHome;
    @BindView(R.id.iv_test)
    ImageView ivTest;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ButterKnife.bind(this);
    }

    @OnClick(R.id.btn_test)
    void onClick(){
        btnTest.setText("test click");
        Glide
                .with(this)
                .load("http://t2.27270.com/uploads/tu/201601/295/1.jpg")
                .placeholder(R.mipmap.ic_launcher)
                .into(ivTest);
    }
    @OnClick(R.id.btn_home)
    void onHomeClick(){
        Intent skipHomeIntent = new Intent(MainActivity.this, HomeActivity.class);
        this.startActivity(skipHomeIntent);
    }
}
